import { Post } from "@/library/utils/request"
import * as types from "@/views/factory_manager/factory_list/types"
import { ResponseWithCount } from "@/library/common/types"

export const FactoryListApiUrl = {
    Select: "/Factory/Select",
    Insert: "/Factory/Insert",
    Update: "/Factory/Update",
    Delete: "/Factory/DeleteById",
}

export const FactoryListApi = {
    /**
     * 查询
     */
    Select(params: types.SelectParamsType) {
        return Post<ResponseWithCount<types.DataType[]>>(FactoryListApiUrl.Select, params)
    },
    /**
     * 新增
     */
    Insert(params: types.InsertType) {
        return Post(FactoryListApiUrl.Insert, params)
    },
    /**
     * 更新
     */
    Update(params: types.UpdateType) {
        return Post(FactoryListApiUrl.Update, params)
    },
    /**
     * 删除
     */
    Delete(params: types.DeleteType) {
        return Post(FactoryListApiUrl.Delete, params)
    },
}